<?php


namespace paySdk\functions\postar\lib\Request\Body\Order;


class UnionPayOrder extends Order
{
    /**
     * protected $atq_tag;
    // 手机号(银联支付必传)
    protected $customer_login;
    // 银联授权码（银联支付 必传）。星pos专用
    protected $user_auth_code;
    // 银联支付标志: UnionPay/1.0 CloudPay（银联支付 必传）。星pos专用
    protected $pay_code;
    // 商店编号（银联支付必传）。星pos专用
    protected $store_id;
     */
    public $union_pay_available_parameters = ["atq_tag", "customer_login", "store_id"];

    public $auto_init_parameters = ["pay_way" => 3];

    public function __construct($parameters = [])
    {
        $this->__set("timestamp", time());
        $this->available_parameters = array_merge($this->available_parameters, $this->union_pay_available_parameters);

        $auto_init_parameters = $this->auto_init_parameters;
        array_walk($auto_init_parameters, function ($value, $ele) {
            $this->__set($ele, $value);
        });

        if (! empty($parameters)) {
            array_walk($parameters, function ($item, $key) {
                $this->__set($key, $item);
            });
            $this->chkParam();
        }
    }

}